package com.corpgovernment.common.base;

import lombok.Data;

import java.util.concurrent.TimeUnit;

/**
 * @auth:yaqiangzhang
 * @date:2019/11/12 11:49
 */
@Data
public class RedisOperation{
    private RedisValueTypeEnum valueType;
    private RedisOperationEnum operation;
    private Object key;
    private Object mapKey;
    private Object value;
    private Long timeoutSecond;
    private TimeUnit timeUnit = TimeUnit.SECONDS;

    public RedisOperation() {
    }

    /**
     * list
     * @param valueType
     * @param operation
     * @param key
     * @param value
     * @param timeoutSecond
     * @param timeUnit
     */
    public RedisOperation(RedisValueTypeEnum valueType, RedisOperationEnum operation, Object key, Object value, Long timeoutSecond, TimeUnit timeUnit) {
        this.valueType = valueType;
        this.operation = operation;
        this.key = key;
        this.value = value;
        this.timeoutSecond = timeoutSecond;
        this.timeUnit = timeUnit;
    }

    /**
     * map
     * @param valueType
     * @param operation
     * @param key
     * @param mapKey
     * @param value
     * @param timeoutSecond
     * @param timeUnit
     */
    public RedisOperation(RedisValueTypeEnum valueType, RedisOperationEnum operation, Object key, Object mapKey, Object value, Long timeoutSecond, TimeUnit timeUnit) {
        this.valueType = valueType;
        this.operation = operation;
        this.key = key;
        this.mapKey = mapKey;
        this.value = value;
        this.timeoutSecond = timeoutSecond;
        this.timeUnit = timeUnit;
    }
}
